3.1.93 \(\int \sqrt {c+d \tan (e+f x)} (A+B \tan (e+f x)+C \tan ^2(e+f x)) \, dx\) [93]

3.1.93.1 Optimal result
3.1.93.2 Mathematica [A] (verified)
3.1.93.3 Rubi [A] (warning: unable to verify)
3.1.93.4 Maple [B] (verified)
3.1.93.5 Fricas [B] (verification not implemented)
3.1.93.6 Sympy [F]
3.1.93.7 Maxima [F]
3.1.93.8 Giac [F(-1)]
3.1.93.9 Mupad [B] (verification not implemented)

3.1.93.1 Optimal result

Integrand size = 35, antiderivative size = 155 \[ \int \sqrt {c+d \tan (e+f x)} \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx=-\frac {(i A+B-i C) \sqrt {c-i d} \text {arctanh}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{f}-\frac {(B-i (A-C)) \sqrt {c+i d} \text {arctanh}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c+i d}}\right )}{f}+\frac {2 B \sqrt {c+d \tan (e+f x)}}{f}+\frac {2 C (c+d \tan (e+f x))^{3/2}}{3 d f} \]

output
-(I*A+B-I*C)*arctanh((c+d*tan(f*x+e))^(1/2)/(c-I*d)^(1/2))*(c-I*d)^(1/2)/f 
-(B-I*(A-C))*arctanh((c+d*tan(f*x+e))^(1/2)/(c+I*d)^(1/2))*(c+I*d)^(1/2)/f 
+2*B*(c+d*tan(f*x+e))^(1/2)/f+2/3*C*(c+d*tan(f*x+e))^(3/2)/d/f
 
3.1.93.2 Mathematica [A] (verified)

Time = 0.59 (sec) , antiderivative size = 150, normalized size of antiderivative = 0.97 \[ \int \sqrt {c+d \tan (e+f x)} \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx=\frac {-3 i (A-i B-C) \sqrt {c-i d} d \text {arctanh}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )+3 i (A+i B-C) \sqrt {c+i d} d \text {arctanh}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c+i d}}\right )+2 \sqrt {c+d \tan (e+f x)} (c C+3 B d+C d \tan (e+f x))}{3 d f} \]

input
Integrate[Sqrt[c + d*Tan[e + f*x]]*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2) 
,x]
 
output
((-3*I)*(A - I*B - C)*Sqrt[c - I*d]*d*ArcTanh[Sqrt[c + d*Tan[e + f*x]]/Sqr 
t[c - I*d]] + (3*I)*(A + I*B - C)*Sqrt[c + I*d]*d*ArcTanh[Sqrt[c + d*Tan[e 
 + f*x]]/Sqrt[c + I*d]] + 2*Sqrt[c + d*Tan[e + f*x]]*(c*C + 3*B*d + C*d*Ta 
n[e + f*x]))/(3*d*f)
 
3.1.93.3 Rubi [A] (warning: unable to verify)

Time = 0.75 (sec) , antiderivative size = 134, normalized size of antiderivative = 0.86, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.314, Rules used = {3042, 4113, 3042, 4011, 3042, 4022, 3042, 4020, 25, 73, 221}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sqrt {c+d \tan (e+f x)} \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \sqrt {c+d \tan (e+f x)} \left (A+B \tan (e+f x)+C \tan (e+f x)^2\right )dx\)

\(\Big \downarrow \) 4113

\(\displaystyle \int (A-C+B \tan (e+f x)) \sqrt {c+d \tan (e+f x)}dx+\frac {2 C (c+d \tan (e+f x))^{3/2}}{3 d f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (A-C+B \tan (e+f x)) \sqrt {c+d \tan (e+f x)}dx+\frac {2 C (c+d \tan (e+f x))^{3/2}}{3 d f}\)

\(\Big \downarrow \) 4011

\(\displaystyle \int \frac {A c-C c-B d+(B c+(A-C) d) \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}}dx+\frac {2 B \sqrt {c+d \tan (e+f x)}}{f}+\frac {2 C (c+d \tan (e+f x))^{3/2}}{3 d f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {A c-C c-B d+(B c+(A-C) d) \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}}dx+\frac {2 B \sqrt {c+d \tan (e+f x)}}{f}+\frac {2 C (c+d \tan (e+f x))^{3/2}}{3 d f}\)

\(\Big \downarrow \) 4022

\(\displaystyle \frac {1}{2} (c+i d) (A+i B-C) \int \frac {1-i \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}}dx+\frac {1}{2} (c-i d) (A-i B-C) \int \frac {i \tan (e+f x)+1}{\sqrt {c+d \tan (e+f x)}}dx+\frac {2 B \sqrt {c+d \tan (e+f x)}}{f}+\frac {2 C (c+d \tan (e+f x))^{3/2}}{3 d f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{2} (c+i d) (A+i B-C) \int \frac {1-i \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}}dx+\frac {1}{2} (c-i d) (A-i B-C) \int \frac {i \tan (e+f x)+1}{\sqrt {c+d \tan (e+f x)}}dx+\frac {2 B \sqrt {c+d \tan (e+f x)}}{f}+\frac {2 C (c+d \tan (e+f x))^{3/2}}{3 d f}\)

\(\Big \downarrow \) 4020

\(\displaystyle \frac {i (c-i d) (A-i B-C) \int -\frac {1}{(1-i \tan (e+f x)) \sqrt {c+d \tan (e+f x)}}d(i \tan (e+f x))}{2 f}-\frac {i (c+i d) (A+i B-C) \int -\frac {1}{(i \tan (e+f x)+1) \sqrt {c+d \tan (e+f x)}}d(-i \tan (e+f x))}{2 f}+\frac {2 B \sqrt {c+d \tan (e+f x)}}{f}+\frac {2 C (c+d \tan (e+f x))^{3/2}}{3 d f}\)

\(\Big \downarrow \) 25

\(\displaystyle -\frac {i (c-i d) (A-i B-C) \int \frac {1}{(1-i \tan (e+f x)) \sqrt {c+d \tan (e+f x)}}d(i \tan (e+f x))}{2 f}+\frac {i (c+i d) (A+i B-C) \int \frac {1}{(i \tan (e+f x)+1) \sqrt {c+d \tan (e+f x)}}d(-i \tan (e+f x))}{2 f}+\frac {2 B \sqrt {c+d \tan (e+f x)}}{f}+\frac {2 C (c+d \tan (e+f x))^{3/2}}{3 d f}\)

\(\Big \downarrow \) 73

\(\displaystyle \frac {(c+i d) (A+i B-C) \int \frac {1}{-\frac {i \tan ^2(e+f x)}{d}-\frac {i c}{d}+1}d\sqrt {c+d \tan (e+f x)}}{d f}+\frac {(c-i d) (A-i B-C) \int \frac {1}{\frac {i \tan ^2(e+f x)}{d}+\frac {i c}{d}+1}d\sqrt {c+d \tan (e+f x)}}{d f}+\frac {2 B \sqrt {c+d \tan (e+f x)}}{f}+\frac {2 C (c+d \tan (e+f x))^{3/2}}{3 d f}\)

\(\Big \downarrow \) 221

\(\displaystyle \frac {\sqrt {c-i d} (A-i B-C) \arctan \left (\frac {\tan (e+f x)}{\sqrt {c-i d}}\right )}{f}+\frac {\sqrt {c+i d} (A+i B-C) \arctan \left (\frac {\tan (e+f x)}{\sqrt {c+i d}}\right )}{f}+\frac {2 B \sqrt {c+d \tan (e+f x)}}{f}+\frac {2 C (c+d \tan (e+f x))^{3/2}}{3 d f}\)

input
Int[Sqrt[c + d*Tan[e + f*x]]*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2),x]
 
output
((A - I*B - C)*Sqrt[c - I*d]*ArcTan[Tan[e + f*x]/Sqrt[c - I*d]])/f + ((A + 
 I*B - C)*Sqrt[c + I*d]*ArcTan[Tan[e + f*x]/Sqrt[c + I*d]])/f + (2*B*Sqrt[ 
c + d*Tan[e + f*x]])/f + (2*C*(c + d*Tan[e + f*x])^(3/2))/(3*d*f)
 

3.1.93.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 73
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[ 
{p = Denominator[m]}, Simp[p/b   Subst[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + 
 d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] && Lt 
Q[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntL 
inearQ[a, b, c, d, m, n, x]
 

rule 221
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x 
/Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4011
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)]), x_Symbol] :> Simp[d*((a + b*Tan[e + f*x])^m/(f*m)), x] + Int 
[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x], x] 
, x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 
 0] && GtQ[m, 0]
 

rule 4020
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + 
(f_.)*(x_)]), x_Symbol] :> Simp[c*(d/f)   Subst[Int[(a + (b/d)*x)^m/(d^2 + 
c*x), x], x, d*Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[ 
b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && EqQ[c^2 + d^2, 0]
 

rule 4022
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)]), x_Symbol] :> Simp[(c + I*d)/2   Int[(a + b*Tan[e + f*x])^m*( 
1 - I*Tan[e + f*x]), x], x] + Simp[(c - I*d)/2   Int[(a + b*Tan[e + f*x])^m 
*(1 + I*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c 
 - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] &&  !IntegerQ[m]
 

rule 4113
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) 
+ (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[C*((a + 
 b*Tan[e + f*x])^(m + 1)/(b*f*(m + 1))), x] + Int[(a + b*Tan[e + f*x])^m*Si 
mp[A - C + B*Tan[e + f*x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && 
NeQ[A*b^2 - a*b*B + a^2*C, 0] &&  !LeQ[m, -1]
 
3.1.93.4 Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(1311\) vs. \(2(130)=260\).

Time = 0.13 (sec) , antiderivative size = 1312, normalized size of antiderivative = 8.46

method result size
parts \(\text {Expression too large to display}\) \(1312\)
derivativedivides \(\text {Expression too large to display}\) \(1472\)
default \(\text {Expression too large to display}\) \(1472\)

input
int((c+d*tan(f*x+e))^(1/2)*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x,method=_RETUR 
NVERBOSE)
 
output
1/4/f/d*ln((c+d*tan(f*x+e))^(1/2)*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)-d*tan(f*x+ 
e)-c-(c^2+d^2)^(1/2))*A*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*(c^2+d^2)^(1/2)-1/f* 
d/(2*(c^2+d^2)^(1/2)-2*c)^(1/2)*arctan(((2*(c^2+d^2)^(1/2)+2*c)^(1/2)-2*(c 
+d*tan(f*x+e))^(1/2))/(2*(c^2+d^2)^(1/2)-2*c)^(1/2))*A-1/4/f/d*ln((c+d*tan 
(f*x+e))^(1/2)*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)-d*tan(f*x+e)-c-(c^2+d^2)^(1/2 
))*A*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*c-1/4/f/d*ln(d*tan(f*x+e)+c+(c+d*tan(f* 
x+e))^(1/2)*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)+(c^2+d^2)^(1/2))*A*(2*(c^2+d^2)^ 
(1/2)+2*c)^(1/2)*(c^2+d^2)^(1/2)+1/f*d/(2*(c^2+d^2)^(1/2)-2*c)^(1/2)*arcta 
n((2*(c+d*tan(f*x+e))^(1/2)+(2*(c^2+d^2)^(1/2)+2*c)^(1/2))/(2*(c^2+d^2)^(1 
/2)-2*c)^(1/2))*A+1/4/f/d*ln(d*tan(f*x+e)+c+(c+d*tan(f*x+e))^(1/2)*(2*(c^2 
+d^2)^(1/2)+2*c)^(1/2)+(c^2+d^2)^(1/2))*A*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*c+ 
B/f*(2*(c+d*tan(f*x+e))^(1/2)+1/4*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*ln((c+d*ta 
n(f*x+e))^(1/2)*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)-d*tan(f*x+e)-c-(c^2+d^2)^(1/ 
2))+((c^2+d^2)^(1/2)-c)/(2*(c^2+d^2)^(1/2)-2*c)^(1/2)*arctan(((2*(c^2+d^2) 
^(1/2)+2*c)^(1/2)-2*(c+d*tan(f*x+e))^(1/2))/(2*(c^2+d^2)^(1/2)-2*c)^(1/2)) 
-1/4*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*ln(d*tan(f*x+e)+c+(c+d*tan(f*x+e))^(1/2 
)*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)+(c^2+d^2)^(1/2))+(-(c^2+d^2)^(1/2)+c)/(2*( 
c^2+d^2)^(1/2)-2*c)^(1/2)*arctan((2*(c+d*tan(f*x+e))^(1/2)+(2*(c^2+d^2)^(1 
/2)+2*c)^(1/2))/(2*(c^2+d^2)^(1/2)-2*c)^(1/2)))+C*(2/3/f/d*(c+d*tan(f*x+e) 
)^(3/2)-1/4/f/d*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*(c^2+d^2)^(1/2)*ln((c+d*t...
 
3.1.93.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 2588 vs. \(2 (123) = 246\).

Time = 0.35 (sec) , antiderivative size = 2588, normalized size of antiderivative = 16.70 \[ \int \sqrt {c+d \tan (e+f x)} \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx=\text {Too large to display} \]

input
integrate((c+d*tan(f*x+e))^(1/2)*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algori 
thm="fricas")
 
output
-1/6*(3*d*f*sqrt(-(f^2*sqrt(-(4*(A^2*B^2 - 2*A*B^2*C + B^2*C^2)*c^2 + 4*(A 
^3*B - A*B^3 + 3*A*B*C^2 - B*C^3 - (3*A^2*B - B^3)*C)*c*d + (A^4 - 2*A^2*B 
^2 + B^4 - 4*A*C^3 + C^4 + 2*(3*A^2 - B^2)*C^2 - 4*(A^3 - A*B^2)*C)*d^2)/f 
^4) + (A^2 - B^2 - 2*A*C + C^2)*c - 2*(A*B - B*C)*d)/f^2)*log((2*(A^3*B + 
A*B^3 + 3*A*B*C^2 - B*C^3 - (3*A^2*B + B^3)*C)*c + (A^4 - B^4 - 4*A^3*C + 
6*A^2*C^2 - 4*A*C^3 + C^4)*d)*sqrt(d*tan(f*x + e) + c) + ((A - C)*f^3*sqrt 
(-(4*(A^2*B^2 - 2*A*B^2*C + B^2*C^2)*c^2 + 4*(A^3*B - A*B^3 + 3*A*B*C^2 - 
B*C^3 - (3*A^2*B - B^3)*C)*c*d + (A^4 - 2*A^2*B^2 + B^4 - 4*A*C^3 + C^4 + 
2*(3*A^2 - B^2)*C^2 - 4*(A^3 - A*B^2)*C)*d^2)/f^4) + (2*(A*B^2 - B^2*C)*c 
+ (A^2*B - B^3 - 2*A*B*C + B*C^2)*d)*f)*sqrt(-(f^2*sqrt(-(4*(A^2*B^2 - 2*A 
*B^2*C + B^2*C^2)*c^2 + 4*(A^3*B - A*B^3 + 3*A*B*C^2 - B*C^3 - (3*A^2*B - 
B^3)*C)*c*d + (A^4 - 2*A^2*B^2 + B^4 - 4*A*C^3 + C^4 + 2*(3*A^2 - B^2)*C^2 
 - 4*(A^3 - A*B^2)*C)*d^2)/f^4) + (A^2 - B^2 - 2*A*C + C^2)*c - 2*(A*B - B 
*C)*d)/f^2)) - 3*d*f*sqrt(-(f^2*sqrt(-(4*(A^2*B^2 - 2*A*B^2*C + B^2*C^2)*c 
^2 + 4*(A^3*B - A*B^3 + 3*A*B*C^2 - B*C^3 - (3*A^2*B - B^3)*C)*c*d + (A^4 
- 2*A^2*B^2 + B^4 - 4*A*C^3 + C^4 + 2*(3*A^2 - B^2)*C^2 - 4*(A^3 - A*B^2)* 
C)*d^2)/f^4) + (A^2 - B^2 - 2*A*C + C^2)*c - 2*(A*B - B*C)*d)/f^2)*log((2* 
(A^3*B + A*B^3 + 3*A*B*C^2 - B*C^3 - (3*A^2*B + B^3)*C)*c + (A^4 - B^4 - 4 
*A^3*C + 6*A^2*C^2 - 4*A*C^3 + C^4)*d)*sqrt(d*tan(f*x + e) + c) - ((A - C) 
*f^3*sqrt(-(4*(A^2*B^2 - 2*A*B^2*C + B^2*C^2)*c^2 + 4*(A^3*B - A*B^3 + ...
 
3.1.93.6 Sympy [F]

\[ \int \sqrt {c+d \tan (e+f x)} \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx=\int \sqrt {c + d \tan {\left (e + f x \right )}} \left (A + B \tan {\left (e + f x \right )} + C \tan ^{2}{\left (e + f x \right )}\right )\, dx \]

input
integrate((c+d*tan(f*x+e))**(1/2)*(A+B*tan(f*x+e)+C*tan(f*x+e)**2),x)
 
output
Integral(sqrt(c + d*tan(e + f*x))*(A + B*tan(e + f*x) + C*tan(e + f*x)**2) 
, x)
 
3.1.93.7 Maxima [F]

\[ \int \sqrt {c+d \tan (e+f x)} \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx=\int { {\left (C \tan \left (f x + e\right )^{2} + B \tan \left (f x + e\right ) + A\right )} \sqrt {d \tan \left (f x + e\right ) + c} \,d x } \]

input
integrate((c+d*tan(f*x+e))^(1/2)*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algori 
thm="maxima")
 
output
integrate((C*tan(f*x + e)^2 + B*tan(f*x + e) + A)*sqrt(d*tan(f*x + e) + c) 
, x)
 
3.1.93.8 Giac [F(-1)]

Timed out. \[ \int \sqrt {c+d \tan (e+f x)} \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx=\text {Timed out} \]

input
integrate((c+d*tan(f*x+e))^(1/2)*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algori 
thm="giac")
 
output
Timed out
 
3.1.93.9 Mupad [B] (verification not implemented)

Time = 16.04 (sec) , antiderivative size = 1199, normalized size of antiderivative = 7.74 \[ \int \sqrt {c+d \tan (e+f x)} \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx=2\,\mathrm {atanh}\left (\frac {32\,B^2\,d^4\,\sqrt {\frac {B^2\,c}{4\,f^2}-\frac {\sqrt {-B^4\,d^2\,f^4}}{4\,f^4}}\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{\frac {16\,B\,d^4\,\sqrt {-B^4\,d^2\,f^4}}{f^3}+\frac {16\,B\,c^2\,d^2\,\sqrt {-B^4\,d^2\,f^4}}{f^3}}-\frac {32\,c\,d^2\,\sqrt {\frac {B^2\,c}{4\,f^2}-\frac {\sqrt {-B^4\,d^2\,f^4}}{4\,f^4}}\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}\,\sqrt {-B^4\,d^2\,f^4}}{\frac {16\,B\,d^4\,\sqrt {-B^4\,d^2\,f^4}}{f}+\frac {16\,B\,c^2\,d^2\,\sqrt {-B^4\,d^2\,f^4}}{f}}\right )\,\sqrt {-\frac {\sqrt {-B^4\,d^2\,f^4}-B^2\,c\,f^2}{4\,f^4}}-2\,\mathrm {atanh}\left (\frac {32\,B^2\,d^4\,\sqrt {\frac {\sqrt {-B^4\,d^2\,f^4}}{4\,f^4}+\frac {B^2\,c}{4\,f^2}}\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{\frac {16\,B\,d^4\,\sqrt {-B^4\,d^2\,f^4}}{f^3}+\frac {16\,B\,c^2\,d^2\,\sqrt {-B^4\,d^2\,f^4}}{f^3}}+\frac {32\,c\,d^2\,\sqrt {\frac {\sqrt {-B^4\,d^2\,f^4}}{4\,f^4}+\frac {B^2\,c}{4\,f^2}}\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}\,\sqrt {-B^4\,d^2\,f^4}}{\frac {16\,B\,d^4\,\sqrt {-B^4\,d^2\,f^4}}{f}+\frac {16\,B\,c^2\,d^2\,\sqrt {-B^4\,d^2\,f^4}}{f}}\right )\,\sqrt {\frac {\sqrt {-B^4\,d^2\,f^4}+B^2\,c\,f^2}{4\,f^4}}-\mathrm {atanh}\left (\frac {f^3\,\sqrt {-\frac {\sqrt {-A^4\,d^2\,f^4}+A^2\,c\,f^2}{f^4}}\,\left (\frac {16\,\left (A^2\,d^4-A^2\,c^2\,d^2\right )\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{f^2}+\frac {16\,c\,d^2\,\left (\sqrt {-A^4\,d^2\,f^4}+A^2\,c\,f^2\right )\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{f^4}\right )}{16\,\left (A^3\,c^2\,d^3+A^3\,d^5\right )}\right )\,\sqrt {-\frac {\sqrt {-A^4\,d^2\,f^4}+A^2\,c\,f^2}{f^4}}-\mathrm {atanh}\left (\frac {f^3\,\sqrt {\frac {\sqrt {-A^4\,d^2\,f^4}-A^2\,c\,f^2}{f^4}}\,\left (\frac {16\,\left (A^2\,d^4-A^2\,c^2\,d^2\right )\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{f^2}-\frac {16\,c\,d^2\,\left (\sqrt {-A^4\,d^2\,f^4}-A^2\,c\,f^2\right )\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{f^4}\right )}{16\,\left (A^3\,c^2\,d^3+A^3\,d^5\right )}\right )\,\sqrt {\frac {\sqrt {-A^4\,d^2\,f^4}-A^2\,c\,f^2}{f^4}}+\mathrm {atanh}\left (\frac {f^3\,\sqrt {-\frac {\sqrt {-C^4\,d^2\,f^4}+C^2\,c\,f^2}{f^4}}\,\left (\frac {16\,\left (C^2\,d^4-C^2\,c^2\,d^2\right )\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{f^2}+\frac {16\,c\,d^2\,\left (\sqrt {-C^4\,d^2\,f^4}+C^2\,c\,f^2\right )\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{f^4}\right )}{16\,\left (C^3\,c^2\,d^3+C^3\,d^5\right )}\right )\,\sqrt {-\frac {\sqrt {-C^4\,d^2\,f^4}+C^2\,c\,f^2}{f^4}}+\mathrm {atanh}\left (\frac {f^3\,\sqrt {\frac {\sqrt {-C^4\,d^2\,f^4}-C^2\,c\,f^2}{f^4}}\,\left (\frac {16\,\left (C^2\,d^4-C^2\,c^2\,d^2\right )\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{f^2}-\frac {16\,c\,d^2\,\left (\sqrt {-C^4\,d^2\,f^4}-C^2\,c\,f^2\right )\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{f^4}\right )}{16\,\left (C^3\,c^2\,d^3+C^3\,d^5\right )}\right )\,\sqrt {\frac {\sqrt {-C^4\,d^2\,f^4}-C^2\,c\,f^2}{f^4}}+\frac {2\,B\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{f}+\frac {2\,C\,{\left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )}^{3/2}}{3\,d\,f} \]

input
int((c + d*tan(e + f*x))^(1/2)*(A + B*tan(e + f*x) + C*tan(e + f*x)^2),x)
 
output
2*atanh((32*B^2*d^4*((B^2*c)/(4*f^2) - (-B^4*d^2*f^4)^(1/2)/(4*f^4))^(1/2) 
*(c + d*tan(e + f*x))^(1/2))/((16*B*d^4*(-B^4*d^2*f^4)^(1/2))/f^3 + (16*B* 
c^2*d^2*(-B^4*d^2*f^4)^(1/2))/f^3) - (32*c*d^2*((B^2*c)/(4*f^2) - (-B^4*d^ 
2*f^4)^(1/2)/(4*f^4))^(1/2)*(c + d*tan(e + f*x))^(1/2)*(-B^4*d^2*f^4)^(1/2 
))/((16*B*d^4*(-B^4*d^2*f^4)^(1/2))/f + (16*B*c^2*d^2*(-B^4*d^2*f^4)^(1/2) 
)/f))*(-((-B^4*d^2*f^4)^(1/2) - B^2*c*f^2)/(4*f^4))^(1/2) - 2*atanh((32*B^ 
2*d^4*((-B^4*d^2*f^4)^(1/2)/(4*f^4) + (B^2*c)/(4*f^2))^(1/2)*(c + d*tan(e 
+ f*x))^(1/2))/((16*B*d^4*(-B^4*d^2*f^4)^(1/2))/f^3 + (16*B*c^2*d^2*(-B^4* 
d^2*f^4)^(1/2))/f^3) + (32*c*d^2*((-B^4*d^2*f^4)^(1/2)/(4*f^4) + (B^2*c)/( 
4*f^2))^(1/2)*(c + d*tan(e + f*x))^(1/2)*(-B^4*d^2*f^4)^(1/2))/((16*B*d^4* 
(-B^4*d^2*f^4)^(1/2))/f + (16*B*c^2*d^2*(-B^4*d^2*f^4)^(1/2))/f))*(((-B^4* 
d^2*f^4)^(1/2) + B^2*c*f^2)/(4*f^4))^(1/2) - atanh((f^3*(-((-A^4*d^2*f^4)^ 
(1/2) + A^2*c*f^2)/f^4)^(1/2)*((16*(A^2*d^4 - A^2*c^2*d^2)*(c + d*tan(e + 
f*x))^(1/2))/f^2 + (16*c*d^2*((-A^4*d^2*f^4)^(1/2) + A^2*c*f^2)*(c + d*tan 
(e + f*x))^(1/2))/f^4))/(16*(A^3*d^5 + A^3*c^2*d^3)))*(-((-A^4*d^2*f^4)^(1 
/2) + A^2*c*f^2)/f^4)^(1/2) - atanh((f^3*(((-A^4*d^2*f^4)^(1/2) - A^2*c*f^ 
2)/f^4)^(1/2)*((16*(A^2*d^4 - A^2*c^2*d^2)*(c + d*tan(e + f*x))^(1/2))/f^2 
 - (16*c*d^2*((-A^4*d^2*f^4)^(1/2) - A^2*c*f^2)*(c + d*tan(e + f*x))^(1/2) 
)/f^4))/(16*(A^3*d^5 + A^3*c^2*d^3)))*(((-A^4*d^2*f^4)^(1/2) - A^2*c*f^2)/ 
f^4)^(1/2) + atanh((f^3*(-((-C^4*d^2*f^4)^(1/2) + C^2*c*f^2)/f^4)^(1/2)...